package pers.csw.lookBook.controller.front;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import pers.csw.lookBook.common.Res;
import pers.csw.lookBook.entity.Chapter;
import pers.csw.lookBook.entity.Content;
import pers.csw.lookBook.service.ContentService;
import pers.csw.lookBook.service.ChapterService;

@CrossOrigin
@RestController
@RequestMapping("/content")
public class ContentController {
    @Autowired
    ContentService contentService;
    @Autowired
    ChapterService chapterService;

    /**
     * 通过章节id返回该章节下的内容荣
     * @param chapterId 章节id
     * @return 返回该章节下的内容荣
     */
    @GetMapping("/getContent/{chapterId}")
    public Res getContent(@PathVariable Integer chapterId){
        return Res.success(contentService.getContent(chapterId));
    }
}
